import request from '@/utils/request'

// 微信公众号用户开始---------------------------
export function getWxUsers(params) {
  return request({
    url: '/wechat/wx_user/',
    method: 'GET',
    params
  })
}

export function addWxUser(data) {
  return request({
    url: '/wechat/wx_user/',
    method: 'POST',
    data
  })
}

export function updateWxUser(data) {
  return request({
    url: `/wechat/wx_user/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delWxUser(id) {
  return request({
    url: `/wechat/wx_user/${id}/`,
    method: 'DELETE',
  })
}

export function delWxUsers(users) {
  console.log(users);
  return request({
    url: '/wechat/wx_user/batch_delete/',
    method: 'DELETE',
    data: users
  })
}

// 微信公众号用户结束----------------------------


// // 微信菜单开始---------------------------
export function getMenu() {
  return request({
    url: '/wechat/menu/',
    method: 'GET',
  })
}


export function createMenu(data) {
  return request({
    url: '/wechat/menu/',
    method: 'POST',
    data,
  })
}

export function deleteMenu(data) {
  return request({
    url: '/wechat/menu/',
    method: 'POST',
    data
  })
}

export function getUserInfos() {
  return request({
    url: '/wechat/userinfo/',
    method: 'GET',
  })
}
// // 微信菜单结束----------------------------


// 用户充值记录开始
export function getRechargeRecords(params) {
  return request({
    url: '/wechat/recharge_record/',
    method: 'GET',
    params
  })
}


export function delRechargeRecords(data) {
  return request({
    url: '/wechat/recharge_record/batch_delete/',
    method: 'DELETE',
    data
  })
}
// 用户充值记录结束

// 微信统一下单结果开始

export function getUnifiedOrderResults(params) {
  return request({
    url: '/wechat/unified_order/',
    method: 'GET',
    params
  })
}

export function delUnifiedOrderResults(data) {
  return request({
    url: '/wechat/unified_order/batch_delete/',
    method: 'DELETE',
    data
  })
}

// 微信统一下单结果结束

// 微信支付结果开始

export function getPayResults(params) {
  return request({
    url: '/wechat/pay_result/',
    method: 'GET',
    params
  })
}

export function delPayResults(data) {
  return request({
    url: '/wechat/pay_result/batch_delete/',
    method: 'DELETE',
    data
  })
}
// 微信支付结果结束

// 客户账号历史信息开始

export function getAccountHis(params) {
  return request({
    url: '/wechat/account_his/',
    method: 'GET',
    params
  })
}

// 客户账号历史信息结束

// 用户赠送金额记录开始
export function getGiftMoneyRecords(params) {
  return request({
    url: '/wechat/gift_money_record/',
    method: 'GET',
    params
  })
}

export function delGiftMoneyRecords(data) {
  return request({
    url: '/wechat/gift_money_record/batch_delete/',
    method: 'DELETE',
    data
  })
}
// 用户赠送金额记录结束

// 赠金使用情况开始

export function getGiftConsumeRecords(params) {
  return request({
    url: '/wechat/gift_consume_record/',
    method: 'GET',
    params
  })
}

export function delGiftConsumeRecords(data) {
  return request({
    url: '/wechat/gift_consume_record/',
    method: 'DELETE',
    data
  })
}
// 赠金使用情况结束

// 充值优惠说明开始
export function getRechargeDesc(params) {
  return request({
    url: '/wechat/recharge_desc/',
    method: 'GET',
    params
  })
}

export function addRechargeDesc(data) {
  return request({
    url: '/wechat/recharge_desc/',
    method: 'POST',
    data
  })
}

export function updateRechargeDesc(data) {
  return request({
    url: `/wechat/recharge_desc/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delRechargeDesc(data_id) {
  return request({
    url: `/wechat/recharge_desc/${data_id}/`,
    method: 'DELETE',
  })
}

// 充值优惠说明结束

// 充值金额设置开始
export function getRecharges(params) {
  return request({
    url: '/wechat/recharge_list/',
    method: 'GET',
    params
  })
}

export function addRecharge(data) {
  return request({
    url: '/wechat/recharge_list/',
    method: 'POST',
    data
  })
}

export function updateRecharge(data) {
  return request({
    url: `/wechat/recharge_list/${data.id}/`,
    method: 'PUT',
    data
  })
}

export function delRecharge(data_id) {
  return request({
    url: `/wechat/recharge_list/${data_id}/`,
    method: 'DELETE',
  })
}

export function delRecharges(data) {
  return request({
    url: '/wechat/recharge_list/batch_delete/',
    method: 'DELETE',
    data
  })
}

// 充值金额设置结束
// 客户账户历史信息开始

export function getHisAccounts(params) {
  return request({
    url: '/wechat/account_his/',
    method: 'GET',
    params
  })
}

export function delHisAccounts(data) {
  return request({
    url: '/wechat/account_his/batch_delete/',
    method: 'DELETE',
    data
  })
}
// 客户账户历史信息结束
// 客户收藏开始

export function getUserCollections(params) {
  return request({
    url: '/wechat/user_collect/',
    method: 'GET',
    params
  })
}

export function delUserCollections(data) {
  return request({
    url: '/wechat/user_collect/batch_delete/',
    method: 'DELETE',
    data
  })
}
// 客户收藏结束